package com.hd.listener;

import java.util.ArrayList;
import java.util.List;

import org.activiti.engine.RepositoryService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.activiti.engine.repository.ProcessDefinition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
 * 连线监听,监听多任务实例
 * @author hzhh123
 * 2018年8月15日下午2:29:12
 */
@Component("lineListener")
public class LineListener implements ExecutionListener {
	@Autowired
	protected RepositoryService repositoryService;
	@Override
	public void notify(DelegateExecution execution) throws Exception {
		/*String processDefinitionId = execution.getProcessDefinitionId(); 
		ProcessDefinition processDefinition = this.repositoryService.createProcessDefinitionQuery()
				.processDefinitionId(processDefinitionId).singleResult();
		String processDefinitionKey = processDefinition.getKey(); 
		System.out.println(execution.getVariable("prevUserid"));*/
		List<String>users=new ArrayList<String>();
		users.add("1");
		users.add("2");
		users.add("3");
		execution.setVariable("users", users);
	}

}
